package com.woody.aggregate.sdk.messagebox;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.woody.aggregate.messagebox.dto.MessageboxAddDTO;
import com.woody.aggregate.messagebox.dto.MessageboxEditDTO;
import com.woody.aggregate.messagebox.dto.MessageboxListDTO;
import com.woody.aggregate.messagebox.vo.MessageboxDetailVO;
import com.woody.aggregate.messagebox.vo.MessageboxInfoVO;
import com.woody.aggregate.messagebox.vo.MessageboxListVO;
import com.woody.base.model.Response;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name="wd-aggregate", contextId = "aggregate-MessageboxFeign", path = "/messagebox")
public interface MessageboxFeign {

    /**
     * 弹框列表
     * @param dto
     * @return
     */
    @PostMapping("/list")
    Response<Page<MessageboxListVO>> list(@RequestBody(required = false) MessageboxListDTO dto);

    /**
     * 弹框详情
     * @param id
     * @return
     */
    @GetMapping("/detail")
    Response<MessageboxDetailVO> detail(@RequestParam(value = "id") Long id);

    /**
     * 删除弹框配置
     * @param id
     * @return
     */
    @GetMapping("/delete")
    Response delete(@RequestParam(value = "id") Long id);

    /**
     * 编辑弹框配置
     * @param dto
     * @return
     */
    @PostMapping("/edit")
    Response edit(@RequestBody @Validated MessageboxEditDTO dto);

    /**
     * 新增弹框配置
     * @param dto
     * @return
     */
    @PostMapping("/add")
    Response add(@RequestBody @Validated MessageboxAddDTO dto);

    /**
     * 启用禁用弹框配置
     * @param id
     * @param enabled true启用 false禁用
     * @return
     */
    @GetMapping("/enable")
    Response enable(@RequestParam(value = "id") Long id,
                           @RequestParam(value = "enabled")  Boolean enabled);
}
